package cn.java63.printer;

public class Printer {
    private String name="huip";
    private int price;//名字和价格
    private Ink ink;
    private Paper paper;
    public Printer(){}

    public Printer(String name, int price) {
        System.out.println("2 constructor");
        this.name = name;
        this.price = price;
    }

    public void print(String s){
        System.out.println("价格为"+price+"元的"+name+" 正在打印：");
        System.out.println("使用墨水是"+ink.getColor());
        paper.print(s);
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }
}
